<?php


/**
 * This class defines the structure of the 'match' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    orm.map
 */
class MatchTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'orm.map.MatchTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('match');
		$this->setPhpName('Match');
		$this->setClassname('Match');
		$this->setPackage('orm');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11, null);
		$this->addForeignKey('FIRST_TEAM', 'FirstTeam', 'INTEGER', 'team', 'ID', false, 11, null);
		$this->addForeignKey('SECOND_TEAM', 'SecondTeam', 'INTEGER', 'team', 'ID', false, 11, null);
		$this->addForeignKey('TOURNAMENT_ID', 'TournamentId', 'INTEGER', 'tournament', 'ID', false, 11, null);
		$this->addColumn('DATE', 'Date', 'DATE', false, null, null);
		$this->addColumn('START_TIME_IST', 'StartTimeIst', 'VARCHAR', false, 10, null);
		$this->addColumn('TEAM_WON', 'TeamWon', 'INTEGER', false, 11, null);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('TeamRelatedByFirstTeam', 'Team', RelationMap::MANY_TO_ONE, array('first_team' => 'id', ), null, null);
    $this->addRelation('TeamRelatedBySecondTeam', 'Team', RelationMap::MANY_TO_ONE, array('second_team' => 'id', ), null, null);
    $this->addRelation('Tournament', 'Tournament', RelationMap::MANY_TO_ONE, array('tournament_id' => 'id', ), null, null);
    $this->addRelation('DailyRecord', 'DailyRecord', RelationMap::ONE_TO_MANY, array('id' => 'match_id', ), null, null);
	} // buildRelations()

} // MatchTableMap
